package com.eshop.modules.user.service.mapper;

import com.eshop.common.mapper.CoreMapper;
import com.eshop.modules.user.domain.UserLevel;
import com.eshop.modules.user.service.dto.UserLevelInfoDto;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserLevelMapper extends CoreMapper<UserLevel> {
    @Select({"SELECT l.id,a.add_time as addTime,l.discount,a.level_id as levelId,l.name,l.icon,l.grade FROM user_level a INNER JOIN system_user_level l ON l.id=a.level_id WHERE a.status = 1 AND a.is_del = 0 AND a.id = #{id} LIMIT 1"})
    UserLevelInfoDto getUserLevelInfo(int i);
}
